<extend name="./public/frame.html"/>
<block name="content">
    <style>
        .layui-table-cell{width:auto;}
        .layui-table-box, .layui-table-view {
            width: 50%;
        }
        .box{
            display: flex;
            flex-wrap: nowrap;
        }

    </style>
    <table class="layui-table">
        <volist name="base_info_arr" id="field">
            <tr>
                <td style="width: 10%;text-align: center;">{$field}</td>
                <td>
                    <eq name="key" value='role_name'>
                        <php>
                            if($admin_type){
                                echo $base_info[$key]."(".$base_info['admin_type'].")";
                            }else{
                                echo $base_info[$key];
                            }
                        </php>
                        <else/>
                        {$base_info[$key]}
                    </eq>
                </td>
            </tr>
        </volist>
    </table>
    <!--<div class="box">
        <gt name="admin_type" value="1">
            <table class="layui-table" lay-data="{height:'auto', url:'{$url_area}', page: true, limit: 10, id:'admin_area'}" lay-filter="admin_area">
                <thead>
                <tr>
                    <th lay-data="{align:'center'}" colspan="3">管理区域</th>
                </tr>
                <tr>
                    <th lay-data="{field:'id', width:80, sort: true}">ID</th>
                    <th lay-data="{field:'name', width:180}">区域名称</th>
                </tr>
                </thead>
            </table>
        </gt>
        <table class="layui-table" lay-data="{height:'auto', url:'{$url_role}', page: true, limit: 10, id:'right'}"
               lay-filter="right">
            <thead>
            <tr>
                <th lay-data="{align:'center'}" colspan="3">个人权限详细</th>
            </tr>
            <tr>
                <th lay-data="{field:'group', width:220}">所属分组</th>
                <th lay-data="{field:'name', width:220}">权限名称</th>
                <th lay-data="{field:'right', width:220}">权限码</th>
                <th lay-data="{toolbar: '#barDemo',width:'auto',fixed:'right',align:'center'}">操作</th>
            </tr>
            </thead>
        </table>
    </div>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-xs" lay-event="detail">详细</a>
    </script>
    <script>
        layui.use('table', function () {
            var table = layui.table;
            //监听工具条
            table.on('tool(right)', function (obj) {
                var data = obj.data; //获得当前行数据
                var layEvent = obj.event; //获得 lay-event 对应的值（也可以是表头的 event 参数对应的值）
                var tr = obj.tr; //获得当前行 tr 的DOM对象
                var id = data.id;
                if(layEvent === 'detail'){
                    layer.open({
                        type: 2,
                        title: data.name+'的权限详情',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['100%', '100%'],
                        content: '{:url("/admin/System/right_detail","id=")}' + id //iframe的url
                    });
                }
            });
        });
    </script>-->
</block>